From: | Christian Hattemer |
Date: | 01 Aug 99 at 17:13:18 |
Subject: | Re: Building structures dynamically |
From: Christian Hattemer <Chris@heaven.riednet.wh.tu-darmstadt.de>
On 30-Jul-99 Allan Odgaard wrote:
> Do you know about C++? Here you can have base-structures and subclasses
No, not yet.
>> I want to use this for a function which reads some data from a file and
>> then puts it into the array. The array is ment to be used mit
>> MUIM_List_Insert.
> Maybe you should look into overloading MUIM_Import/Export for the
> list-object? That's what I normally do when I need to load'n'save the
> contents of a MUI listview.
Yes, you suggest this to me sometimes... ;-)
But it would then be necessary to change the rest of the config code to use
IFF also.
I'm quite happy with the existing code (which I want to take over from my
previous program), and I'm not sure if using IFF would make the main problem
simpler.
>> I want to have to struct dynamic to be able to use the function to read
>> several types of data (i. e. several different structs) without changing
>> the code.
> I'm not sure if I follow this - if all you want is to read a file, and add
> all items found in the file to a MUI listview - then this sounds like a
> trivial job. Or is there more to it?
Please look at my second reply in this thread for more information on my
idea.
> instead of an array - or perhaps you should repeatedly use
> MUIM_List_InsertSingle for each item, instead of loading the entire thing
> in one big array (then ensure the list has proper construct and destruct
> hooks to make a copy of the data)
This is what I'm currently doing. Currently every record in the file also
has a ID number, and I want to change this. When reading all entries at once
the IDs won't be needed and I could insert everything at once.
Bye, Chris
DOS - Durchweg ohne Sinn